package com.runing.controller;


import com.runing.config.ResponseWrapper;
import com.runing.entity.MVersion;
import com.runing.service.impl.MVersionServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lel
 * @since 2021-03-13
 */
@RestController
@RequestMapping("/mVersion")
@Api(tags = "手机类型和版本号")
public class MVersionController {

    @Autowired
    MVersionServiceImpl versionService;

    @ApiOperation("增加版本消息")
    @PostMapping("/addVersion")
    public ResponseWrapper addVersion(@RequestBody MVersion version){
        ResponseWrapper wrapper = versionService.addVersion(version);
        return wrapper;
    }

    @ApiOperation("导出excel")
    @GetMapping("/verExcel")
    public void excel(HttpServletResponse response)throws IOException {
        versionService.verExcel(response);
        return;
    }

}

